import java.math.BigInteger;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User:何人亮
 * Date:2024-11-25
 * 19:29
 */
class Test{
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        BigInteger[] b=new BigInteger[n];
        for(int i=0;i<n;i++){//给定n个整数
            int ni=sc.nextInt();
            String s=String.valueOf(ni);
            b[i]=new BigInteger(s);
        }
        BigInteger num=BigInteger.ZERO;
        BigInteger squarses=BigInteger.ZERO;
        BigInteger count=BigInteger.ZERO;
//        for(int i=0;i<n;i++){
//            for(int j=i+1;j<n;j++){
//                num=num.add(b[i].multiply(b[j]));
//            }
//        }           可以这两个for循环代替下面的内容，但是时间复杂度是O(n^2),下面却是O(n)更优

        for(int i=0;i<n;i++){//(a+b)^2=a^2+b^2+2ab;
            num=num.add(b[i]);
            squarses=squarses.add(b[i].multiply(b[i]));
        }
        count=num.multiply(num).subtract(squarses);
        count=count.divide(new BigInteger("2"));//所以两两相称==（a+b+c+……n）^2-a^2-n^2再整体除以2；
        System.out.print(count);
    }
}
